package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TBookLocationInfoMapper;
import com.ruoyi.system.domain.TBookLocationInfo;
import com.ruoyi.system.service.ITBookLocationInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 存储位置Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-06-08
 */
@Service
public class TBookLocationInfoServiceImpl implements ITBookLocationInfoService 
{
    @Autowired
    private TBookLocationInfoMapper tBookLocationInfoMapper;

    /**
     * 查询存储位置
     * 
     * @param id 存储位置主键
     * @return 存储位置
     */
    @Override
    public TBookLocationInfo selectTBookLocationInfoById(Long id)
    {
        return tBookLocationInfoMapper.selectTBookLocationInfoById(id);
    }

    /**
     * 查询存储位置列表
     * 
     * @param tBookLocationInfo 存储位置
     * @return 存储位置
     */
    @Override
    public List<TBookLocationInfo> selectTBookLocationInfoList(TBookLocationInfo tBookLocationInfo)
    {
        return tBookLocationInfoMapper.selectTBookLocationInfoList(tBookLocationInfo);
    }

    /**
     * 新增存储位置
     * 
     * @param tBookLocationInfo 存储位置
     * @return 结果
     */
    @Override
    public int insertTBookLocationInfo(TBookLocationInfo tBookLocationInfo)
    {
        tBookLocationInfo.setCreateTime(DateUtils.getNowDate());
        return tBookLocationInfoMapper.insertTBookLocationInfo(tBookLocationInfo);
    }

    /**
     * 修改存储位置
     * 
     * @param tBookLocationInfo 存储位置
     * @return 结果
     */
    @Override
    public int updateTBookLocationInfo(TBookLocationInfo tBookLocationInfo)
    {
        tBookLocationInfo.setUpdateTime(DateUtils.getNowDate());
        return tBookLocationInfoMapper.updateTBookLocationInfo(tBookLocationInfo);
    }

    /**
     * 批量删除存储位置
     * 
     * @param ids 需要删除的存储位置主键
     * @return 结果
     */
    @Override
    public int deleteTBookLocationInfoByIds(String ids)
    {
        return tBookLocationInfoMapper.deleteTBookLocationInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除存储位置信息
     * 
     * @param id 存储位置主键
     * @return 结果
     */
    @Override
    public int deleteTBookLocationInfoById(Long id)
    {
        return tBookLocationInfoMapper.deleteTBookLocationInfoById(id);
    }
}
